<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>grid Creation</title>
</head>
<body>
	
		
	<%
	String _beanName     	= "beanName";
	//---------------------- title bar variable ----------------------//
	String panelGroupId 	= "pGroupId";
	String titleBarName 	= "msg.label_daniel_claimResult";
	String render			= "";
	String stopSignGroupNo	= "1";
	
	//---------------------- grid -----------------------------------//
String[] gridBean={	"artlGrpVO"	,"artlGrpVO"	,"artlGrpVO"	};
String[] value={	"articleGrpName"	,"articleGrpName"	,"articleGrpName"	};
String[] msgCode={	"label_temp_age"	,"label_temp_BusinessType"	,"label_temp_name"	};
String[] acBoxMsg={	"age"	,""	,""	};
String[] acBoxCss={	""	,""	,""	};
String[] labelMsg={	""	,"Business Type"	,""	};
String[] buttonMsg={	""	,""	,"name"	};
String[] buttonId={	""	,""	,""	};
String[] buttonOnClick={	""	,""	,""	};
%>
	
	<!-- start generte -->
	<c:set var="module">
		<jsp:text>
			<![CDATA[
				<!-- @panelGroupId@ -->
				<ui:include src="../common/TitleBar.jspx">
					<ui:param name="tid" value="@panelGroupId@Title" />
					<ui:param name="panelGroupId" value="@panelGroupId@" />
					<ui:param name="titleBarName" value="#{@titleBarName@}" />
					<ui:param name="stopSignGroupNo" value="@stopSignGroupNo@" />
					<ui:param name="rendered" value="#{@beanName@.@render@}" />
				</ui:include>
				<ice:panelGroup id="@panelGroupId@">
					<ice:panelGrid columns="2" styleClass="pnlCenterAlign" rowClasses="tblAvgHeight">
						@simpleGrid@
					</ice:panelGrid>
				</ice:panelGroup>
			]]>
		</jsp:text>
	</c:set>

	<c:set var="iceAcInputText">
		<jsp:text>
			<![CDATA[
				<!-- @acBoxMsg@ -->
				<ice:panelGrid id="@value@Icon@tmp@" styleClass="stopSignItem">
					<ice:outputLabel value="#{msg.@msgCode@}" />
				</ice:panelGrid>
				<ice:panelGrid columns="2">
					<ice:panelGroup styleClass="yui-skin-sam">
						<ice:panelGroup	id="@value@Div@tmp@"
										styleClass="yui-ac">
							<ice:inputText	id="@value@"
											value="#{@beanName@.@value@}"
											onfocus="asSingle(this);"
											styleClass="#{@acBoxCss@}"
											onchange="processPageValueChange();" 
											disabled="#{ReviseMode}"
											maxlength="9"
											onkeypress="return disabledEnterKey();">
								<taglib:numberConverter	pattern="###" type="Integer" />
							</ice:inputText>
							<div id="myContainer_@value@" class="yui-ac-container" />
						</ice:panelGroup>
					</ice:panelGroup>
					<ice:outputText id="@value@_text" 
									style="padding-left: 4px;"
									value="#{@beanName@.@value@}" />
					<ice:message	for="@value@"
									errorClass="errorMsg"
									infoClass="infoMsg"
									warnClass="warnMsg"
									fatalClass="fatalMsg"
									showDetail="false"
									showSummary="true" />
					<ice:inputHidden id="@value@_texthidden"	value="#{@beanName@.@value@}" />
				</ice:panelGrid>
			]]>
		</jsp:text>
	</c:set>
	

	<c:set var="iceOutputText">
		<jsp:text>
			<![CDATA[
				<!-- @labelMsg@ -->
				<ice:outputLabel value="#{msg.@msgCode@}"/>
				<ice:outputText value="#{@beanName@.@value@}"/>
			]]>
		</jsp:text>
	</c:set>
	
	<c:set var="iceCommandButton">
		<jsp:text>
			<![CDATA[
				<ice:commandButton	id="#{@buttonId@}"
									value="#{msg.@msgCode@}"
									onClick="@buttonOnClick@"/>
			]]>
		</jsp:text>
	</c:set>

	<%
	//-----------------  to generate bar -------------------------//
	String _module=(String)pageContext.getAttribute("module");
	_module=_module.replaceAll("@panelGroupId@",panelGroupId);
	_module=_module.replaceAll("@titleBarName@",titleBarName);
	_module=_module.replaceAll("@stopSignGroupNo@",stopSignGroupNo);
	if (render.equals(""))
		_module=_module.replaceAll("<ui.*render.*>","");
	else
		_module=_module.replaceAll("@render@",render);
	if (stopSignGroupNo.equals(""))
		_module=_module.replaceAll("<ui.*stopSignGroupNo.*>","");
	else
		_module=_module.replaceAll("@stopSignGroupNo@",stopSignGroupNo);
	
	
	String _gridView="";
	for (int i=0;i<value.length;i++){
		String _content="";
		if (!acBoxMsg[i].equals("")){
			_content=(String)pageContext.getAttribute("iceAcInputText");
			_content=_content.replaceAll("@beanName@",gridBean[i]);
			_content=_content.replaceAll("@msgCode@",msgCode[i]);
			_content=_content.replaceAll("@value@",value[i]);
			_content=_content.replaceAll("@acBoxMsg@",acBoxMsg[i]);
			if (acBoxCss[i].equals(""))
				_content=_content.replaceAll("styleClass=.*\"","");
			else
				_content=_content.replaceAll("@acBoxCss@",acBoxCss[i]);
		
			_content=_content.replaceAll("@tmp@",Integer.toString(i));
		}
		if (!labelMsg[i].equals("")){
			_content=(String)pageContext.getAttribute("iceOutputText");
			_content=_content.replaceAll("@labelMsg@",labelMsg[i]);
			_content=_content.replaceAll("@msgCode@",msgCode[i]);
			_content=_content.replaceAll("@beanName@",gridBean[i]);
			_content=_content.replaceAll("@value@",value[i]);
		}
		
		if (!buttonMsg[i].equals("")){
			_content=(String)pageContext.getAttribute("iceCommandButton");
			if (buttonId[i].equals(""))
				_content=_content.replaceAll("id=.*\"","");
			else
				_content=_content.replaceAll("buttonId",buttonId[i]);
			if (buttonOnClick[i].equals(""))
				_content=_content.replaceAll("onClick=.*\"","");
			else
				_content=_content.replaceAll("@buttonOnClick@",buttonOnClick[i]);
			_content=_content.replaceAll("@msgCode@",msgCode[i]);
		}
		
		_gridView+=_content;
	}
	
  	_module=_module.replaceAll("@simpleGrid@",_gridView);
  	%>
	<pre>
		<c:out value="<%=_module%>"/>
	</pre>

 
</body>
</html>